import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import About from '../views/About.vue'
import PageOne from "@/views/PageOne";
import PageTwo from "@/views/PageTwo";
import PageThree from "@/views/PageThree";
import PageFour from "@/views/PageFour";
import Index from '../views/Index.vue'
import BookUpdate from "@/views/BookUpdate.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Index,
    show:true,
    redirect:"/pagefour",
    children:[
      {
        path: '/pageone',
        name: '页面一',
        component: PageOne
      },
      {
        path: '/pagetwo',
        name: '页面二',
        component: PageTwo
      }
    ]
  },
  {
    path: '/',
    name:'1111',
    component: Index,
    show: false,
    children: [{
      path: '/bookupdate',
      name: 'update',
      component: BookUpdate
    }]
  },
  {
    path: '/about',
    name: '导航2',
    component: Index,
    show:true,
    children:[
      {
        path: '/pagethree',
        name: '页面3',
        component: PageThree
      },
      {
        path: '/pagefour',
        name: '页面4',
        component: PageFour
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
